% This is the function to calculate complexity of connections between components and the topological complexity
function C2=interaction_Complexity(A,f)
[r,c]=size(A); % Get the number of row and column of matrix
sum=0;
for i=1:r
    for j=1:c
        if(A(i,j)~=0)  
        sum=sum+A(i,j)*f;
        end
    end
end
C2=sum;
end

